/**
 * HTTP api接口
 * Name = httpApi
 * DateTime = Sun Jan 16 2022 21:00:32 GMT+0800 (中国标准时间)
 * Author = Created by zhj9922
 * FileBasename = httpApi.ts
 * gitee： https://gitee.com/coyeking
 */
import { httpManager } from '../framework/httpManager';
export class httpApi {
	/**
     * 获取系统信息
     * @param succCallBack 成功返回
     * @param errCallBack 错误返回
     */
    public static getSystemInfo (succCallBack?: (response?: any) => void, errCallBack?: (response?: any) => void) {
        let route:string = "/index.php/api/index/getSystemInfo";
        httpManager.get(route,{},succCallBack,errCallBack);
    };

    /**
     * 账号密码登录
     * @param data 
     * @param succCallBack 
     * @param errCallBack 
     */
    public static login (data:any,succCallBack?: (response?: any) => void, errCallBack?: (response?: any) => void) {
        let route:string = "/index.php/api/user/login";
        httpManager.post(route,data,succCallBack,errCallBack);
    };
    
    /**
     * 用户注册
     * @param data 
     * @param succCallBack 
     * @param errCallBack 
     */
    public static register (data:object,succCallBack?: (response?: any) => void, errCallBack?: (response?: any) => void) {
        let route:string = "/index.php/api/user/register";
        httpManager.post(route,data,succCallBack,errCallBack);
    };
    
    /**
     * 获取用户信息
     * @param succCallBack 
     * @param errCallBack 
     */
    public static getUserInfo (succCallBack?: (response?: any) => void, errCallBack?: (response?: any) => void) {
        let route:string = "/index.php/api/user/getUserInfo";
        httpManager.get(route,{},succCallBack,errCallBack);
    };
    
	/**
     * 获取商品列表
     * @param succCallBack 成功返回
     * @param errCallBack 错误返回
     */
     public static getGoodList (succCallBack?: (response?: any) => void, errCallBack?: (response?: any) => void) {
        let route:string = "/index.php/api/shop/getGoodList";
        httpManager.get(route,{},succCallBack,errCallBack);
    };
    
    /**
     * 创建组局
     * @param data 
     * @param succCallBack 
     * @param errCallBack 
     */
     public static createRoom (data:object,succCallBack?: (response?: any) => void, errCallBack?: (response?: any) => void) {
        let route:string = "/index.php/api/room/createRoom";
        httpManager.post(route,data,succCallBack,errCallBack);
    };
}

